import '../models/user.dart';
import '../repositories/user_repository.dart';

class UserService {
  final UserRepository _repository;

  UserService(this._repository);

  Future<List<User>> getUsers() async {
    try {
      return await _repository.getUsers();
    } catch (e) {
      rethrow;
    }
  }

  Future<User> getUserById(int id) async {
    try {
      return await _repository.getUserById(id);
    } catch (e) {
      rethrow;
    }
  }
}